import {
  Message,
  MessageBox
} from 'element-ui'
let common = {
  // 消息提示
  msg(msg, type) {
    this.option ? this.option.close() : '';
    this.option = Message({
      message: msg,
      type: type || 'warning',
      center: true,
      offset: 350,
      duration: 1000,
    })
  },
  // 确认消息
  confirmMsg(tit, successFuc = '') {
    MessageBox(tit, '提示', {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning'
    }).then(() => {
      successFuc();
    }).catch(() => {

    })
  }
}
export default common